package com.four.collage.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.four.collage.entity.Groupgoods;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.four.collage.vo.GoodsAndAttrVo;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author gs
 * @since 2021-12-18
 */
public interface GroupgoodsMapper extends BaseMapper<Groupgoods> {

    /**
     * 添加拼团商品
     * @param groupgoods
     */
    void addGroupGoods(@Param("gr") Groupgoods groupgoods);

    /**
     * 根据拼团商品id查询信息
     * 修改时回显
     * @param grId
     * @return
     */
    Groupgoods getGroupgoodsById(@Param("grId") Integer grId);

    /**
     * 根据拼团商品id修改
     * @param groupgoods
     */
    void updateGroupgoods(@Param("gr") Groupgoods groupgoods);

    /**
     根据拼团商品id删除商品
     * @param grId
     */
    void delGroupgoodsById(@Param("grId") Integer grId);

    /**
     * 查询id
     * @return
     */
    int slelectMaxId();

    /**
     * 拼团列表、模糊、精准、分页
     *
     * @param groupPage
     * @param vo
     * @return
     */
    IPage<Groupgoods> groupGoodsList( Page<Groupgoods> groupPage,@Param("vo") GoodsAndAttrVo vo);
}
